package com.heimdallr.rbac.permission.entity;

import java.io.Serializable;
import java.util.List;

/**
 *
 * @author Administrator
 * @date 2016/7/29
 */
public class MenuEntity implements Serializable {

    public MenuEntity(){
        super();
    }

    public MenuEntity(int id,int pid,String name,String url){
        this.id = id;
        this.pid = pid;
        this.name = name;
        this.url = url;
    }

    private Integer id;
    private Integer pid;
    private String name;
    private String url;
    private List<MenuEntity> children;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<MenuEntity> getChildren() {
        return children;
    }

    public void setChildren(List<MenuEntity> children) {
        this.children = children;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        MenuEntity that = (MenuEntity) o;

        return id != null ? id.equals(that.id) : that.id == null;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}
